home *** CD-ROM | disk | FTP | other *** search
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- --- W A M ---
- Wow Another Modem Program.
-
- Copyright(c) N. Franks & Associates P/L 1985.
- All rights reserved worldwide.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Neville Franks.
- 3 Pullman Crt,
- East St.Kilda
- Victoria, 3183
- Australia
- Ph. (03)528 2516
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- WAM Vers 2.00 Documentation. 4/May/85 (c) N. Franks & Assoc P/L 1985
-
-
-
-
- **********************************************************************
- *** THIS RELEASE OF WAM IS PLACED INTO THE PUBLIC DOMAIN, NO ***
- *** WARRANTY INTENDED OR IMPLIED. ***
- *** This program may be copied and used for NON-COMMERCIAL ***
- *** purposes only. Any commercial use conflicts with copyright ***
- *** and the offenders may be liable for criminal prosecution. ***
- **********************************************************************
-
-
- WAM is a portable, easy to use communications package. It has a
- command structure similar to the users operating system, with
- the addition of communications commands and a powerful
- programable shell. WAM provides Dumb Terminal communications
- with automatic buffering, as well as File transfer facilities
- using Christensen protocols. CP/M and MSDOS operating systems
- are currently supported. WAM is well behaved and does not
- interfere with the users operating system.
-
- WAM has two basic modes of operation Local and Remote. In Local
- mode WAM works in a similar manner to most communications
- programs, ie. commands are issued from the local terminal to
- control the program. However when in remote mode WAM is
- controlled from the system communicating with WAM. The local
- console (host) still has a limited number of commands available
- such as returning WAM to local mode. By adding autoanswer
- facilities to WAM a simple remote access system becomes possible.
-
- WAM makes use of a simple general purpose shell and command
- processor. The shell allows multiple commands per line, and
- provides `if then else' and `while' constructs. All commands
- return values back to the shell, which can then be used in `if'
- and `while' tests. The shell is extensible, allowing new
- commands to be added easily. Command aliases and variable
- substitution are also available. Input to the shell can come
- from a file or the console. This enables startup conditions to
- be set, or automated communications sessions to be held.
-
- WAM is written in C and adheres to Unix V7 standards. The Aztec
- C compiler, assembler and linker have been used. This compiler
- is available for a number of 8 and 16 bit Cpu's and also a
- variety of operating systems. The current version of WAM is
- available for Cp/m-80, Cp/m-86 and MS-DOS 2 operating systems.
- DOS directories and Cp/m user areas are supported. All operating
- system specific routines are contained in one source file, and
- hardware specific functions in another.
-
- This document briefly describes WAM Version 2.0. This version
- of WAM is being placed in the public domain to illicit comment
- and suggestions. WAM is an evolutionary product which is still
- under development and testing. The source code and documentation
- will probably be available at a later date for a nominal fee.
-
-
-
-
- 2
-
-
-
-
-
- WAM Vers 2.00 Documentation. 4/May/85 (c) N. Franks & Assoc P/L 1985
-
-
- WAM COMMAND PROCESSOR USAGE.
-
- cmd ; cmd where ; is the command separator.
- IF cmd Start if block
- ELSE [cmd] else clause for if
- FI end if [else] block
- WHILE cmd Start while block
- BREAK Break out of while block
- END End while block
- !cmd Not operator - used with if & while
-
- eg.
- C>>while !test -m dcd ; echo -n waiting for carrier\r ; end
-
- C>>if yn run logon script y/n ? ; script logon ; fi
-
- C>>if del fred.c ; echo file deleted ; else echo file not found ; fi
-
- C>>if sb wam5.doc ; term ; rb ; else ; echo couldn't send file ;
- sleep 5 ; fi
-
- The if/else constructs can be nested and blocks can span any
- number of lines. You must be carefull to match if/else/fi pairs.
- If nothing happens when you enter a command it is probably
- because you are in an IF or ELSE block which is not being
- executed. To get back to if level 0 enter FI until the message
- "No matching if" appears.
-
- While loops must be contained on a single line and cannot be
- nested, they can however be within an if block, or have if blocks
- within them. Break would normally be used with an if and will
- skip all commands until the matching end is encountered. You can
- break out of an infinite loop by pressing any key on the keyboard
- (a few times). This has the same effect as break.
-
- The not operator "!" is used to negate the result of commands. It
- is most useful with the while construct as in the example above.
-
-
- WAM command line editing.
-
- WAM has provides some simple editing commands.
- ^R repeats the previous command line from the current position
- on the new cmd line up to the end of the previous one.
- ^X deletes the command line. ^R will restore it.
- Delete & Backspace perform a destructive backspace.
-
-
-
-
-
-
-
-
-
-
-
- 3
-
-
-
-
-
- WAM Vers 2.00 Documentation. 4/May/85 (c) N. Franks & Assoc P/L 1985
-
-
- WAM STARTUP OPTIONS AND SCRIPT FILES.
-
- WAM [-p] [filename [arg1...argn]]
- -p enables priviledged mode. This allows some normally
- restricted remote commands to be used.
-
- filename is an input command file (script). This file will be
- processed when WAM starts, after which WAM will go into
- interactive mode. If the cmd `bye' is in the file then WAM will
- return to the operating system. If filename is not in the current
- directory then the directories specified in the dos path command
- will be searched.
- An example startup file might contain the following:-
-
- rem this is a sample startup file
- echo loading startup file
- rem connect to line and set baud rate
- mdm on ; baud 300
- rem see if user wants to open a capture file
- if yn open capture file y/n?
- cap open bbs ; cap xon ; cap on
- fi
- rem if carrier detected go into terminal mode else command mode
- if test -m dcd ; term ; else echo no carrier detected ; fi
-
- The startup file would also be used for defining aliases and
- performing other initialization. By using the rxwait commands
- etc; it is possible to automate a complete communications
- session with a script file.
-
-
- The SCRIPT command provides the ability to load and run input
- files. Scripts can be nested and can contain while loops, even
- if there is a while loop running in an outer level. This
- provides a rudimentry method for running nested while loops, as
- do aliases. Script commands return the value of the last command
- executed back to the shell. This enables scripts to determine
- the next action be taken by the caller. Variable substitution is
- also provided.
-
- if script logon ; term ; else sb *.c ; fi
-
- where the logon script may be as follows:-
- while !test -m dcd ; echo -n waiting for carrier\r ; end
- if yn terminal mode y/n ?
-
- See also the script file `logon.wam' and the examples on page 11.
-
-
-
-
-
-
-
-
-
-
- 4
-
-
-
-
-
- WAM Vers 2.00 Documentation. 4/May/85 (c) N. Franks & Assoc P/L 1985
-
-
- WAM COMMAND SUMMARY:-
-
- WAM commands can be entered in upper or lower case.
-
- `dpfe' means [d:][path][filename[.ext]] where filename & ext can
- be ambiguous in most cases.
- Under Cp/m path can be `nn/x:' where nn is the cp/m user number
- and x: the drive specification.
-
- `message' can include the following:-
- \r specifies a carriage return char
- \n specifies a new line char (line feed)
- \b specifies a back space char
- \t specifies a tab char
- \f specifies a form feed char
- \" specifies a double quote char
- \\ specifies the '\' char
- \nnn where <nnn> is 1, 2 or 3 decimal digits which specify the
- value of the desired character.
-
- A message or string can also be enclosed in double quotes. This
- allows whitespace or command separator characters to be included
- in strings. ie, echo " a space & cmd sep ;;; example"
-
- Multiple commands can be passed as whole by including them within
- single quotes. This is mainly for use with the alias command.
- ie, alias r 'rn $1 ; term'
-
- If a command has an alias with the same name the alias will be
- run in place of the command. If this occurs, recursion is
- prevented by temporarily disabling aliasing. An example would be
- `alias dir dir $1 -wdr'. Entering `dir *.h' will alias into `dir
- *.h -wdr' with the built-in dir command being executed. Aliases
- can be nested and used within script files. An alias can use any
- built-in command, construct, other alias or script file and
- multiple commands can be used by entering them within single
- quotes as discussed above. Aliases provide a powerful way to
- create new commands or just change the names of existing commands.
-
- Scripts and aliases provide variable substitution by matching
- parameters with $number strings, where number is between 0 and 9.
- `$0' is the script filename or alias command itself, and `$1-$9'
- are the corresponding variables in the command line.
- eg.
- Enter `alias e 'echo $2 ; term $1 ; dir $3 '' then
- `e hello john *.wam' would be parsed into
- `echo john ; term hello ; dir *.wam'.
-
- To setup aliases in a script, which require variable
- substitution, preceed the `$' with a `\' ie. \$1. This prevents
- substitution occuring. See the script file `alias.wam' for
- examples.
-
-
-
-
-
- 5
-
-
-
-
-
- WAM Vers 2.00 Documentation. 4/May/85 (c) N. Franks & Assoc P/L 1985
-
-
- WAM COMMAND SUMMARY:-
-
- D - means dos only. C - means cp/m only.
- L - means valid in local mode only.
- R - means valid in remote mode only.
- P - means valid in remote mode if priviledged startup option was
- used.
-
-
- Local/Remote commands.
-
- Name Meaning
- ------- -----------
- DL CLS Clear screen
-
- DF [d:] Display free disk space.
-
- DIR [dpfe..] -dwpr Directory display. -d date order (dos),
- -w wide, -p page, -r reverse order
-
- LP DEL dpfe [dpfe..] -a
- Delete file(s). -a Ask first
-
- LP ERASE See DEL
-
- LP ERA See DEL
-
- TYPE dpfe [dpfe..] -p
- Type file(s). -p page mode
-
-
- x: change default drive to `x:'
-
- D CD [[d:]path] Display current dos path or change to
- new path.
-
- C USER [nn] Display/Change Cp/m user number.
-
- L TERM [message] If message is present send message, else
- go into terminal mode.
-
- L RXWAIT [char] Go into terminal mode. When "char" is
- received return to command mode. If no
- argument use char set by "set rxwait
- char". Returns true if `char' received
- else false if terminal mode abandoned.
-
- L CAP [OPEN dpfe[-a]] [CLOSE] [ON OFF] [SAVE ZAP] [XON NONE]
- [nnnn]
-
- L OPEN [-a] Open the file dpfe for capture buffer use.
- If the file exists, it will by default be
- opened in append mode. If the -a option
- is used you will instead be given a choice.
-
-
-
- 6
-
-
-
-
-
- WAM Vers 2.00 Documentation. 4/May/85 (c) N. Franks & Assoc P/L 1985
-
-
- L CLOSE Closes the currently open capture file and
- turns capture off. Also closed when
- leaving WAM.
-
- L ON OFF Sets capture mode Off/On.
-
- L SAVE Save the capture buffer to the currently
- open file.
-
- L ZAP Zap the capture buffer.
-
- L XON Enables Xon/Xoff handshaking with auto
- disk saves if capture file open.
-
- L NONE Disables Xon/Xoff handshaking
-
- L nnnn Sets the capture buffer size.
- Default size is 16K
-
-
- S [A B N] dpfe [dpfe..]
- Send file(s) in Ascii, Batch or Normal
- mode. Batch and Normal mode use
- Christensen protocol. Batch mode is
- compatible with YAM and Normal with
- XMODEM and YAM.
-
- R [A B N] [path] Receive file in Ascii, Batch or Normal
- mode. If path is present files will be
- placed in that path.
-
- L BAUD [nnnn] Display baud rate, or set new baud rate.
-
- L MDM [ON OFF] Display status or Enable/Disable Modem.
- On sets DTR & RTS, while off resets them.
-
- L SET Display current set parameters.
-
- L STOP key Set the stop key value. The default stop
- key is ^_
-
- L RXWAIT char Set the default rxwait character. This
- is used by the "rxwait" command with no
- argument.
-
- L PAUSE nnn Set .1 sec timer variable. This is
- machine dependant and comes initialized
- for the harware in use. If you wish to
- change it use the sleep command to
- establish the best value.
-
- L PACE nnn Set pace variable. This is used to slow
- down WAM output when in remote mode.
-
-
-
-
- 7
-
-
-
-
-
- WAM Vers 2.00 Documentation. 4/May/85 (c) N. Franks & Assoc P/L 1985
-
-
- L VIEW [ON OFF] sets View mode off/on. (Used in file
- transfers)
-
- L VIEW [ASCII HEX] sets View mode to Ascii/Hex
-
- L SLEEP [nnnn] Sleep for nnn seconds.
-
-
- L REMOTE Switch to remote mode.
-
- L LISTEN Listen for a call and answer it. This is
- currently only being used for testing.
-
- R MSG [message] Send message to host. If no message
- prompt for one.
-
- ECHO [on off] [[-n] message]
- turn console echo on/off or echo message
- to console. if -n is specified then don't
- send a NL sequence at end of message. If
- no arguments display echo status.
-
- REM [message] message is just a remark. Useful for
- putting remarks in input files. this
- function always returns true.
-
- L TEST [-m [cts dsr ri dcd]]
- returns rs-232 input status where:-
- cts is clear to send
- dsr is data set ready
- ri is ring indicator
- dcd is data carrier detect
-
- [-f filename] returns true if file `filename' exists.
-
- L YN [message] display message and wait for Y or N
- response from console. returns true if Y
- pressed, else false.
-
- L BYE Return to operating system. Modem stays
- connected. If there is an open capture
- file it will be closed. If the capture
- buffer isn't empty you will be prompted
- to save it first.
-
- L QUIT See BYE. Modem is disconnected.
-
-
-
-
-
-
-
-
-
-
-
- 8
-
-
-
-
-
- WAM Vers 2.00 Documentation. 4/May/85 (c) N. Franks & Assoc P/L 1985
-
-
- DL DOS [prog [params]] Temporary Exit to DOS or Run prog. WAM
- remains resident and the modem stays
- connected. This lets you use any dos
- commands or run any programs and then
- return to WAM. If prog isn't specified
- then WAM invokes another copy of the dos
- command processor. When you want to
- return to WAM type "exit" at the DOS
- prompt. If prog is specified then it
- will be run using params. When it is
- finished, control will be returned to WAM.
- If prog is not found in the current
- directory or along PATH then return
- false. If prog contains a path spec then
- that will be searched instead of the
- current directory.
-
-
- L SCRIPT name [arg1...argn]
- process script file "name" as input to
- WAM. Script files can use all WAM
- commands. There is no limit to the size
- of a script and scripts can call other
- scripts. A script returns the value of
- the last command executed in the script
- to the caller. When a script returns
- execution continues at the command
- following the script command. Scripts
- can also use the while construct even if
- there is one executing outside of it. The
- arguments, if any are used for variable
- substitution.
-
- ALIAS name [wordlist]
- With no parameters displays all current
- aliases, with just name displays the
- alias for name if present. Otherwise
- wordlist is associated with name as a new
- alias. Wordlist is a single command, or
- multiple commands enclosed in single
- quotes. When an alias is run it returns
- the value of the last command executed to
- the shell.
-
- ALIAS [off on] Turns off/on all current aliases.
-
- UNALIAS name Removes name from aliases.
-
-
- HELP Display brief help information.
-
-
-
-
-
-
-
- 9
-
-
-
-
-
- WAM Vers 2.00 Documentation. 4/May/85 (c) N. Franks & Assoc P/L 1985
-
-
- HOST commands:- These commands are initiated by pressing a single
- key only on the host console.
-
- R or STOP KEY Remote OFF.
-
- E Toggle host Echo Off/On.
-
- M Send message to remote. You are prompted
- for the message.
-
- B Bye - Return to operating system. This
- will be removed at a later date.
-
- H or ? Help
-
-
- TERM commands:- These commands are initiated by pressing the STOP KEY
- followed by the cmd key rapidly.
-
- C Toggle capture buffer off/on. When on
- text received in terminal mode is placed
- into the capture buffer.
-
- Z Zap capture buffer
-
- S Save capture buffer. A capture file must
- already be open.
-
- STOP KEY Exit term mode. Returns true to command
- processor if were using "term" or false
- if using "rxchar".
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 10
-
-
-
-
-
- WAM Vers 2.00 Documentation. 4/May/85 (c) N. Franks & Assoc P/L 1985
-
-
- COMMAND SCRIPT EXAMPLES:
-
- rem a sample script to download files from an rcpm system and
- rem disconnect when finished.
- mdm on ; baud 300
- while !test -m dcd ; echo -n waiting for carrier\r ; end
- if test -m dcd
- sleep 1 ; term \n\n\n ; tell'm were here
- set rxwait ^G ; rem bell means ready for name
- rxwait ; term John ; rxwait ; term Citizen
- rxwait > ; rem wait for cp/m prompt
- term xyam ; rem fire up xyam etc;
- set rxwait ?
- rxwait ; term b1: ; rem tell it what to do
- term b1: ; rem log to B0:
- rxwait ; term sb *.c *.h ; rem send some files
- rb ; rem receive in batch mode
- rxwait ; term quit ; rem back to cp/m
- rxwait ; term bye ; rxwait ; term n ; rem all done disconnect
- bye
- else
- echo logon \7abandoned
- fi
-
-
- rem a sample ibbs logon script
- rem usage: wam5 logon firstname lastname password
- rem given script filename is `logon'
- rem
- echo \nlogon to ibbs
- mdm on ; baud 300
- cap open ibbs ; cap xon ; cap on
- while !test -m dcd ; echo -n waiting for carrier\r \r ; end
- if test -m dcd
- sleep 1 ; term \n\n\n ; rem let'm no were here
- if rxwait ?
- term $1 ; rem send firstname
- rxwait ? ; term $2 ; rem then lastname
- set rxwait > ; rem used from now on
- rxwait ; term $3 ; rem password
- rem whatever
- rxwait ; term m ; rem message subsystem
- term
- rxwait ; term g ; rem goodbye
- rxwait ; term y ; rem Yes i'm sure
- term
- else
- echo logon failed $1
- fi
- else
- echo logon abandoned $1
- fi
-
-
-
-
-
- 11
-
-
-
-
-
- WAM Vers 2.00 Documentation. 4/May/85 (c) N. Franks & Assoc P/L 1985
-
-
- TYPICAL MODEM RS-232 CONNECTION
-
- MODEM PC
- 1 ---- 1 PG. Protective ground
- 2 <-- 2 TD. Transmit Data
- 3 --> 3 RD. Receive Data
- 4 <-- 4 RTS. Request to send
- 5 --> 5 CTS. Clear to send
- 6 --> 6 DSR. Data set ready
- 7 ---- 7 SG. Signal ground
- 8 --> 8 DCD. Data carrier detect
- 20 <-- 20 DTR. Data terminal ready
- 22 --> 22 RI. Ring indicator
-
- Handshake Lines.
- RTS - Indicates the pc is ready to transmit data. The modem then
- enables it's transmit carrier and sets DSR.
- DSR - Indicates the modem is ready to establish communications
-
- DCD - Indicates the modem is detecting carrier.
-
- RI - Indicates that a telephone ringing signal has been received
- by the modem.
-
- DTR - Informs the modem the pc is ready to communicate. The
- modem then connects to the phone line, and normally
- acknowledges by setting CTS.
- CTS - Indicates the modem is ready to establish communications.
-
-
- NOTES:
- Ascii Send and Receive are not currently implemented.
- Viewing of received data has been temporarily removed.
- The stop key is used to abandon terminal mode and also to abort
- Send/Recv commands. The current version of WAM does not make use
- of any RS-232 input lines, but has a complete set of functions
- for monitoring their status. The ouput lines DTR and RTS are
- set/reset by mdm on/off commands respectively. Setting DTR
- normally enables the modem to connect to the line. The mdm
- command with no options displays the status of the RS-232 lines.
- The test -m command permits testing of individual input lines.
- WAM will happily send and receive files at 4800 baud on the PC
- and faster on some other machines. In Terminal mode WAM has
- trouble keeping up at 4800 baud without the send system slowing
- down it's output by using line pacing or some equivalent
- system. WAM itself slows down output when in remote mode. The
- amount being determined by the value set in the pace variable.
-
- ** Unix is a trademark of Bell Labs.
- ** CP/M is a trademark of Digital Research.
- ** DOS is a trademark of Microsoft.
- ** AZTEC C II is copyright(c) Manx Software Systems.
-
- /**-- The End --**/
-
-
-
- 12
-
-
-
-
-